<!DOCTYPE HTML>
<html lang="fr" ng-app="websem">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Content-Language" content="fr">
        <link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css">
        <link rel = "stylesheet" type = "text/css" href = "css/master.css">
        <script src="js/jquery.min.js"></script>
        <script src="js/angular.js"></script>
        <script src="js/angular-ui.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/ui-bootstrap.min.js"></script>
		<script src="js/angular-route.js"></script>
        <script src="js/master.js"></script>
    </head>
    <body>
        <div class="container" ng-controller="WebsemController">
			<h1>SemSearch</h1>
			<div class = "row">
				<form class="form-group" role="form" ng-submit="search(word);">
					<div class="col-md-6 col-md-offset-3">
						<div class="input-group">
							<div class="input-group-btn">
								<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
									<span class="glyphicon glyphicon-chevron-down"></span>
								</button>
								<ul class="dropdown-menu" role="menu">
									<li ng-repeat="elem in requetes">
										<a ng-click = "remplir(elem.requete);">{{elem.requete}}</a>
									</li>
								</ul>
							</div>
							<input type="text" class="form-control" id="inputSearch" placeholder="Entrez des mots-clefs" ng-model="word">
							<span class="input-group-btn">
								<button type="submit" class="btn btn-default">
									<span class="glyphicon glyphicon-search"></span>
								</button>
							</span>
						</div>
					</div>
				</form>
			</div>
			<div>
				<div ng-show = "liste" id = "results" class = "col-md-8">
					<fieldset>
						<legend>
							Résultats pour la requete "{{query}}" :
						</legend>
						<ul>
							<li ng-repeat="elem in liste">
								<a href="resources/{{elem}}">{{elem}}</a>
							</li>
						</ul>
					</fieldset>
				</div>
				<div id = "stats" ng-controller="AccordionCtrl" class = "col-md-4 pull-right">
					<fieldset>
						<legend>
							Evaluateur :
						</legend>
						<accordion>
							<accordion-group heading="Moyennes" is-open="open">
								<ul class = "row">
									<li class = "col-md-6">
										Rapels :
										<ul>
											<li>à 5 : {{moyenneRappel5}}</li>
											<li>à 10 : {{moyenneRappel10}}</li>
											<li>à 25 : {{moyenneRappel25}}</li>
											<li>Total : {{moyenneRappel}}</li>
										</ul>
									</li>
									<li class = "col-md-6">
										Précisions :
										<ul>
											<li>à 5 : {{moyennePrecision5}}</li>
											<li>à 10 : {{moyennePrecision10}}</li>
											<li>à 25 : {{moyennePrecision25}}</li>
											<li>Total : {{moyennePrecision}}</li>
										</ul>
									</li>
								</ul>
							</accordion-group>
							<accordion-group ng-repeat="requeteStats in statistiques" heading="{{requeteStats.requete}}" is-open="requeteStats.open" id="{{requeteStats.id}}">
								<ul class = "row">
									<li class = "col-md-6">
										Rapels :
										<ul>
											<li>à 5 : {{requeteStats.rappel5}}</li>
											<li>à 10 : {{requeteStats.rappel10}}</li>
											<li>à 25 : {{requeteStats.rappel25}}</li>
											<li>Total : {{requeteStats.rappel}}</li>
											<li>Moyenne : {{requeteStats.moyenneRappel}}</li>
										</ul>
									</li>
									<li class = "col-md-6">
										Précisions :
										<ul>
											<li>à 5 : {{requeteStats.precision5}}</li>
											<li>à 10 : {{requeteStats.precision10}}</li>
											<li>à 25 : {{requeteStats.precision25}}</li>
											<li>Total : {{requeteStats.precision}}</li>
											<li>Moyenne : {{requeteStats.moyennePrecision}}</li>
										</ul>
									</li>
								</ul>
							</accordion-group>
						</accordion>
					</fieldset>
					
					
					<!--					<fieldset>
											<legend>
												Statistiques :
											</legend>
											<ul>
												<li>
													Rapels :
													<ul>
														<li>à 5 : {{rappel5}}</li>
														<li>à 10 : {{rappel10}}</li>
														<li>à 25 : {{rappel25}}</li>
														<li>Total : {{rappel}}</li>
														<li>Moyenne : {{moyenneRapel}}</li>
													</ul>
												</li>
												<li>
													Précisions :
													<ul>
														<li>à 5 : {{precision5}}</li>
														<li>à 10 : {{precision10}}</li>
														<li>à 25 : {{precision25}}</li>
														<li>Total : {{precision}}</li>
														<li>Moyenne : {{moyennePrecision}}</li>
													</ul>
												</li>
											</ul>
										</fieldset>-->
				</div>
			</div>
			<div class="alert alert-primary" ng-show="error">
				{{error}}
			</div>
        </div>
    </body>
</html>